package com.bocloud.cmp.driver.providers.jd;

import com.bocloud.cmp.driver.providers.AuthDriver;
import com.bocloud.cmp.driver.providers.ImageDriver;
import com.bocloud.common.model.BsmResult;

public class JdAuthDriver extends JdDriver implements AuthDriver {

	/**
	 * 
	 */
	public JdAuthDriver() {
		super();
	}

	/**
	 * @param accessKey
	 * @param secretKey
	 * @param endpoint
	 * @param region
	 */
	public JdAuthDriver(String accessKey, String secretKey, String endpoint, String region) {
		super(accessKey, secretKey, endpoint, region);
	}

	@Override
	public BsmResult auth() {
		ImageDriver driver = new JdImageDriver(this.getAccessKey(), this.getSecretKey(), this.getEndpoint(),
				this.getRegion());
		BsmResult result = driver.list();
		result = new BsmResult(result.isSuccess(), "" + result.isSuccess());
		return result;
	}

}
